Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

containers: fix swap for PiercedStorage<bool> #318

Merged
merged 1 commit into from
Jul 13, 2022

Conversation

andrea-iob
Copy link
Member

The [] operator of std::vector returns a temporary object of a proxy type called std::vector::reference, rather than an actual bool&.

Although the libstdc++ defines an overload for swapping this type of proxy objects, this is just an extension to the standard.

Without this change bitpit doesn't compile with gcc 12.

@andrea-iob andrea-iob added the bug label Jun 25, 2022
@andrea-iob andrea-iob self-assigned this Jun 25, 2022
@andrea-iob andrea-iob marked this pull request as ready for review June 26, 2022 07:10
The [] operator of std::vector<bool> returns a temporary object of a
proxy type called std::vector<bool>::reference, rather than an actual
bool&.

Although the libstdc++ defines an overload for swapping this type of
proxy objects, this is just an extension to the standard.
@andrea-iob
Copy link
Member Author

I've added a comment.

@andrea-iob andrea-iob merged commit b81ba59 into master Jul 13, 2022
@andrea-iob andrea-iob deleted the containers.fix.bool.swap branch July 13, 2022 07:26
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants